package cn.mldn.homework.networkProgramming.TCP;

import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class TCPServer
{
	public static void main(String[] args) throws Exception
	{ 
		ServerSocket serverSocket = new ServerSocket(8002);
		
		Socket client = serverSocket.accept();
		
		System.out.println("开始发送信息.....");
		
		OutputStream outputStream = client.getOutputStream();
		outputStream.write("hello,world".getBytes());
		
		Thread.sleep(5000);
		
		System.out.println("信息发送完毕.....");
		
		outputStream.close();
		client.close();
	}
}
